using System.Data;
using Microsoft.EntityFrameworkCore.Storage;

namespace Microsoft.EntityFrameworkCore.Dm.Storage.Internal;

public class DmBoolTypeMapping : BoolTypeMapping
{
	public DmBoolTypeMapping(string storeType, DbType? dbType)
		: base(storeType, dbType)
	{
	}

	protected DmBoolTypeMapping(RelationalTypeMappingParameters parameters)
		: base(parameters)
	{
	}//IL_0001: Unknown result type (might be due to invalid IL or missing references)


	protected override string GenerateNonNullSqlLiteral(object value)
	{
		if (!(bool)value)
		{
			return "0";
		}
		return "1";
	}

	protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return (RelationalTypeMapping)(object)new DmBoolTypeMapping(parameters);
	}
}
